/*
 * author      : 吴中勤 
 * date        : 2019/3/12
 * description : TODO
 */


/*
 * author      : dormi330
 * date        : 2018/6/30
 * description : 统一封装 http 响应
 */

package org.wzq.learn;

public class HttpResponseAssembler {


    public static <T> HttpResponsePayload<T> happy(T payload) {
        return new HttpResponsePayload<T>(null, payload);
    }

    public static HttpResponsePayload happy() {
        return new HttpResponsePayload<>(null, null);
    }

    public static HttpResponsePayload unhappy(String code, String msg) {
        return new HttpResponsePayload(null, code, msg);
    }

    public static HttpResponsePayload unhappy(int code, String msg) {
        return new HttpResponsePayload(null, code + "", msg);
    }
}
